/*
 * Copyright (c) 2020.
 * http://www.ulabcare.com
 */

package com.mt.roll.upms.params;

import com.mt.roll.core.base.BaseParam;
import com.mt.roll.core.validator.groups.AddGroup;
import com.mt.roll.core.validator.groups.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Email;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 系统组织表
 * </p>
 *
 * @author jiff
 * @date 2018/11/9
 * @since 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "系统组织", description = "用于新增和更新组织信息")
public class SysOrgParam extends BaseParam {

    private static final long serialVersionUID = 1L;

    /**
     * 主键，自增
     */
    @ApiModelProperty(value = "主键，更新时需要填写", example = "1")
    @NotNull(message = "组织ID不能为空", groups = {UpdateGroup.class})
    private Long id;

    /**
     * 父组织ID
     */
    @ApiModelProperty(value = "父组织ID", required = true, example = "0")
    @NotNull(message = "父组织不能为空", groups = {AddGroup.class})
    @Min(message = "父组织ID不能小于0", value = 0, groups = {AddGroup.class})
    private Long parentId;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称", required = true, example = "销售部")
    @NotBlank(message = "名称不能为空")
    private String name;

    /**
     * 联系人
     */
    @ApiModelProperty(value = "联系人", example = "jiff")
    private String contact;

    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话", example = "13588441519")
    private String phone;

    /**
     * 联系地址
     */
    @ApiModelProperty(value = "联系地址", example = "中国人工智能小镇")
    private String address;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱", example = "jiff@ulabcare.com")
    @Email
    private String email;

    /**
     * 备注
     */
    @ApiModelProperty("备注")
    private String remark;


}
